<template>
  <fs-page>
    <fs-crud ref="crudRef" v-bind="crudBinding">
      <template #actionbar-right>
        <importExcel api="api/sales/marketing-plan/" v-auth="'MarketingPlanModelViewSet:Import'">导入</importExcel>
      </template>
    </fs-crud>
  </fs-page>
</template>

<script lang="ts">
import { defineComponent, onMounted, getCurrentInstance } from 'vue';
import { useFs } from '@fast-crud/fast-crud';
import createCrudOptions from './crud';
import importExcel from '/@/components/importExcel/index.vue';

export default defineComponent({
  name: "MarketingPlanModelViewSet",
  components: { importExcel },
  setup() {
    const instance = getCurrentInstance();
    const context: any = {
      componentName: instance?.type.name
    };

    const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context });

    onMounted(() => {
      crudExpose.doRefresh();
    });

    return {
      crudBinding,
      crudRef
    };
  }
});
</script> 